<%@ page language="java" contentType="text/html; charset=UTF-8"	 pageEncoding="UTF-8"%>
<%@ include file="../include/laypublic.jsp"%>
<!DOCTYPE html>
<html>
<head>
  <title>标后总结新增</title>
</head>
<style>
	.fieldset{
		margin-top: 5px;
		margin-bottom: 0px
	}
	.layui-legend{
		background-color:#5fb878;
		font-size:15px !important;
		width:140px;
	}
	.layui-form-item {
	    margin-bottom: 5px;
	    clear: both;
	    *zoom: 1;
	}
	.layui-form-label{width: 180px;}
	.right{
		float:right;
	}
	.width106{
		width:106px;
	}
	.width98{
		width:98px;
	}
	.width60{
		width:60px;
	}
	.width30{
		width:30px;
	}
</style>
<body>
<div class="layui-fluid">
    <div class="layui-card">
	    <div class="layui-tab-item layui-show">
	    	<div style="padding-top:15px;">&nbsp;</div>
			<form class="layui-form" id="addInfo_form" lay-filter="add_info_from">
				<fieldset class="layui-elem-field layui-field-title fieldset"  id="baseInfo">
				  <legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目基础信息  ></legend>
				  <div style="margin-top:20px">
				  	<div class="layui-form-item">
				  		<div class="layui-inline">
					      	<label class="layui-form-label">申请公司</label>
					      	<div class="layui-input-inline">
					      		<input type="hidden" name="hrOrgid" value="${bindOrgId}">
								<input type="text" value="${bindOrgName}" style="border: 0px;" readonly="readonly" class="layui-input">
					      	</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">申请部门</label>
				      		<div class="layui-input-inline">
				      			<input type="hidden" name="hrDeptid" value="${bindDeptId}">
								<input type="text" value="${bindDeptName}" style="border:0px;" readonly="readonly" class="layui-input">
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">申请人</label>
				      		<div class="layui-input-inline">
				        		<input type="hidden" name="hrStaffApplyid" readonly="readonly" value="${SESSION_KEY_USER_DETAIL.hrStaffId }">
				        		<input type="text" name="staffname" value="${staffName }" readonly="readonly" style="border:0px" class="layui-input">
				      		</div>
					    </div>
				    </div>
				  	<div class="layui-form-item">
				  		<div class="layui-inline">
					      	<label class="layui-form-label">项目名称</label>
					      	<div class="layui-input-inline">
					        	<select name="proCodeAndCodes" lay-filter="add_select_proId" lay-verify="required" lay-search>
		              				<option value="">请选择-项目名称</option>
				              		<c:if test="${not empty deciPros }">
				              			<c:forEach items="${deciPros}" var="deciPro">
				              				<option value="${deciPro.proCode }_${deciPro.id }_${deciPro.proName }_${deciPro.sgCityId }">${deciPro.proName }</option>
					            		</c:forEach>
				              		</c:if>
				              	</select>						        
					      	</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">项目类型</label>
				      		<div class="layui-input-inline">
						        <input type="text" value="PPP项目" style="border:0px;" readonly="readonly" class="layui-input">
						        <input type="hidden" name="types" value="1">
				      		</div>
					    </div>
					    <div class="layui-inline">
					    	<label class="layui-form-label">投标部门</label>
				      		<div class="layui-input-inline">
				      			<select id="id_hrDeptName" name="hrDeptMktId" lay-verify="required" lay-filter="add_select_hrDeptName">
								</select>
				      		</div>
					    </div>
				    </div>
				  	
				  	<div class="layui-form-item">
				  		<div class="layui-inline">
					    	<label class="layui-form-label">营销经理</label>
				      		<div class="layui-input-inline">
				        		<input type="hidden" id="hrStaffId" name="hrStaffMktId">
				        		<input type="text" id="id_hrStaffName" name="hrStaffName" readonly="readonly" style="border:0px" class="layui-input">
				      		</div>
					    </div>
					    <div class="layui-inline">
							<label class="layui-form-label">投标截止日期</label>
							<div class="layui-input-inline">
								<input type="text" class="layui-input" id="id_bidEndDate" name="bidEndDate" style="border:0px;" readonly>
							</div>
						</div>
				  		<div class="layui-inline">
					    	<label class="layui-form-label">是否中标</label>
				      		<div class="layui-input-inline">
					      		<select id="add_select_isBidFlag" name="bidFlag" lay-verify="required" lay-filter="add_select_isBidFlag">
					      			<option value="">请选择-是否中标</option>
					      			<option value="0">否</option>
					      			<option value="1">是</option>
								</select>
				      		</div>
					    </div>
		    		</div>
		  		</div>
			</fieldset>
			<fieldset class="layui-elem-field layui-field-title fieldset"  id="bidInfo">
		  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">投标信息 ></legend>
			  	<div style="margin-top:20px">
			  		<fieldset class="layui-elem-field layui-field-title fieldset"  id="recordAndRank">
				  		<legend style="margin-left:40px;font-size:15px;font-weight:bold;">开标记录及排名  ></legend>
					  	<div style="margin-top:20px">			  				
		  					<div class="layui-inline">
						    	<label class="layui-form-label">排名</label>
					      		<div class="layui-input-inline">
						      		<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
					      		</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label" style="text-align:left;width:90px;">单位名称</label>
						      	<div class="layui-input-inline">
						        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
						      	</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label" style="text-align:left;width:110px;">得分</label>
						      	<div class="layui-input-inline">
						        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
						      	</div>
						    </div>
						</div>
						<div style="margin-top:20px">  
						    <div class="layui-form-item" id="rankRow1">
						    	<div class="layui-inline width106">
							    	<label class="layui-form-label">1</label>
							    	<div class="layui-input-inline">
							    		<input type="hidden" name="itemIdxRank" value="1"/>
							    	</div>
							    </div>
							    <div class="layui-inline">
							    	<label class="layui-form-label"></label>
						      		<div class="layui-input-inline" style="margin-left:80px;">
							      		<input type="text" name="itemNameRank" placeholder="请输入单位名称" maxlength="500" autocomplete="off" lay-verify="required" class="layui-input">
						      		</div>
							    </div>
							    <div class="layui-inline">
							      	<label class="layui-form-label" style="width:48px;"></label>
							      	<div class="layui-input-inline">
							      		<input type="text" name="itemScoreRank" placeholder="请输入得分" autocomplete="off" 
							      			onblur="isNumberAndFloat1(this);" lay-verify="required|floatAmount" class="layui-input">
							      	</div>
							    </div>
							    <div class="layui-inline">
							    	<button type="button" class="layui-btn layui-btn-sm" id="addRankBtn1" onclick="addRankRow(this);"><i class="layui-icon">&#xe654;</i></button>
							    	<button type="button" class="layui-btn layui-btn-sm" style="display:none" id="delRankBtn1" onclick="delRankRow(1)"><i class="layui-icon">&#xe640;</i></button>
							    </div>
						  	</div>
						</div>	    
			  		</fieldset>
			  	</div>
			  	
			  	<div style="margin-top:20px">
			  		<fieldset class="layui-elem-field layui-field-title fieldset"  id="summaryBid">
				  		<legend style="margin-left:40px;font-size:15px;font-weight:bold;">中标单位报价  ></legend>
					  	<div style="margin-top:20px">			  				
		  					<div class="layui-inline">
						    	<label class="layui-form-label">序号</label>
					      		<div class="layui-input-inline">
						      		<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
					      		</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label" style="text-align:left;width:90px;">名称</label>
						      	<div class="layui-input-inline">
						        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
						      	</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label" style="text-align:left;width:110px;">报价</label>
						      	<div class="layui-input-inline">
						        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
						      	</div>
						    </div>
						</div>
						<div style="margin-top:20px">  
						    <div class="layui-form-item" id="bidRow1">
						    	<div class="layui-inline width106">
							    	<label class="layui-form-label">1</label>
							    	<div class="layui-input-inline">
							    		<input type="hidden" name="bidIdxBid" value="1"/>
							    	</div>
							    </div>
							    <div class="layui-inline">
							    	<label class="layui-form-label"></label>
						      		<div class="layui-input-inline" style="margin-left:70px;">
							      		<input type="text" name="bidNameBid" value="合理利润率" readonly="readonly" style="border:0px" lay-verify="required" class="layui-input">
						      		</div>
							    </div>
							    <div class="layui-inline">
							      	<label class="layui-form-label" style="width:58px;"></label>
							      	<div class="layui-input-inline">
							      		<input type="text" name="bidPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">
							      	</div>
							    </div>
							    <div class="layui-inline">
							    	<button type="button" class="layui-btn layui-btn-sm" id="addBidBtn1" onclick="addBidRow(this);"><i class="layui-icon">&#xe654;</i></button>
							    	<button type="button" class="layui-btn layui-btn-sm" id="delBidBtn1" onclick="delBidRow(1)"><i class="layui-icon">&#xe640;</i></button>
							    </div>
						  	</div>
						  	<div class="layui-form-item" id="bidRow2">
						    	<div class="layui-inline width106">
							    	<label class="layui-form-label">2</label>
							    	<div class="layui-input-inline">
							    		<input type="hidden" name="bidIdxBid" value="2"/>
							    	</div>
							    </div>
							    <div class="layui-inline">
							    	<label class="layui-form-label"></label>
						      		<div class="layui-input-inline" style="margin-left:70px;">
							      		<input type="text" name="bidNameBid" value="折现率" readonly="readonly" style="border:0px" lay-verify="required" class="layui-input">
						      		</div>
							    </div>
							    <div class="layui-inline">
							      	<label class="layui-form-label" style="width:58px;"></label>
							      	<div class="layui-input-inline">
							      		<input type="text" name="bidPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">
							      	</div>
							    </div>
							    <div class="layui-inline">
							    	<button type="button" class="layui-btn layui-btn-sm" id="addBidBtn2" onclick="addBidRow(this);"><i class="layui-icon">&#xe654;</i></button>
							    	<button type="button" class="layui-btn layui-btn-sm" id="delBidBtn2" onclick="delBidRow(2)"><i class="layui-icon">&#xe640;</i></button>
							    </div>
						  	</div>
						  	<div class="layui-form-item" id="bidRow3">
						    	<div class="layui-inline width106">
							    	<label class="layui-form-label">3</label>
							    	<div class="layui-input-inline">
							    		<input type="hidden" name="bidIdxBid" value="3"/>
							    	</div>
							    </div>
							    <div class="layui-inline">
							    	<label class="layui-form-label"></label>
						      		<div class="layui-input-inline" style="margin-left:70px;">
							      		<input type="text" name="bidNameBid" value="投资回报率" readonly="readonly" style="border:0px" lay-verify="required" class="layui-input">
						      		</div>
							    </div>
							    <div class="layui-inline">
							      	<label class="layui-form-label" style="width:58px;"></label>
							      	<div class="layui-input-inline">
							      		<input type="text" name="bidPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">
							      	</div>
							    </div>
							    <div class="layui-inline">
							    	<button type="button" class="layui-btn layui-btn-sm" id="addBidBtn3" onclick="addBidRow(this);"><i class="layui-icon">&#xe654;</i></button>
							    	<button type="button" class="layui-btn layui-btn-sm" id="delBidBtn3" onclick="delBidRow(3)"><i class="layui-icon">&#xe640;</i></button>
							    </div>
						  	</div>
						  	<div class="layui-form-item" id="bidRow4" >
						    	<div class="layui-inline width106">
							    	<label class="layui-form-label">4</label>
							    	<div class="layui-input-inline">
							    		<input type="hidden" name="bidIdxBid" value="4"/>
							    	</div>
							    </div>
							    <div class="layui-inline">
							    	<label class="layui-form-label"></label>
						      		<div class="layui-input-inline" style="margin-left:70px;">
							      		<input type="text" name="bidNameBid" value="工程下浮率" readonly="readonly" style="border:0px" lay-verify="required" class="layui-input">
						      		</div>
							    </div>
							    <div class="layui-inline">
							      	<label class="layui-form-label" style="width:58px;"></label>
							      	<div class="layui-input-inline">
							      		<input type="text" name="bidPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">
							      	</div>
							    </div>
							    <div class="layui-inline">
							    	<button type="button" class="layui-btn layui-btn-sm" id="addBidBtn4" onclick="addBidRow(this);"><i class="layui-icon">&#xe654;</i></button>
							    	<button type="button" class="layui-btn layui-btn-sm" id="delBidBtn4" onclick="delBidRow(4)"><i class="layui-icon">&#xe640;</i></button>
							    </div>
						  	</div>
						</div>	    
			  		</fieldset>
			  	</div>
			  	
			  	<div style="margin-top:20px">
			  		<fieldset class="layui-elem-field layui-field-title fieldset"  id="summaryOur" style="display:none">
				  		<legend style="margin-left:40px;font-size:15px;font-weight:bold;">我司报价  ></legend>
					  	<div style="margin-top:20px">			  				
		  					<div class="layui-inline">
						    	<label class="layui-form-label">序号</label>
					      		<div class="layui-input-inline">
						      		<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
					      		</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label" style="text-align:left;width:90px;">名称</label>
						      	<div class="layui-input-inline">
						        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
						      	</div>
						    </div>
						    <div class="layui-inline">
						      	<label class="layui-form-label" style="text-align:left;width:110px;">报价</label>
						      	<div class="layui-input-inline">
						        	<input type="text" value="" readonly="readonly" style="border:0px" class="layui-input">
						      	</div>
						    </div>
						</div>
						<div style="margin-top:20px">  
						    <div class="layui-form-item" id="ourRow1">
						    	<div class="layui-inline width106">
							    	<label class="layui-form-label">1</label>
							    	<div class="layui-input-inline">
							    		<input type="hidden" name="ourIdxOur" value="1"/>
							    	</div>
							    </div>
							    <div class="layui-inline">
							    	<label class="layui-form-label"></label>
						      		<div class="layui-input-inline" style="margin-left:70px;">
							      		<input type="text" name="ourNameOur" value="合理利润率" readonly="readonly" style="border:0px" lay-verify="required" class="layui-input">
						      		</div>
							    </div>
							    <div class="layui-inline">
							      	<label class="layui-form-label" style="width:58px;"></label>
							      	<div class="layui-input-inline">
							      		<input type="text" name="ourPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">
							      	</div>
							    </div>
							    <div class="layui-inline">
							    	<button type="button" class="layui-btn layui-btn-sm" id="addOurBtn1" onclick="addOurRow(this);"><i class="layui-icon">&#xe654;</i></button>
							    	<button type="button" class="layui-btn layui-btn-sm" id="delOurBtn1" onclick="delOurRow(1)"><i class="layui-icon">&#xe640;</i></button>
							    </div>
						  	</div>
						  	<div class="layui-form-item" id="ourRow2">
						    	<div class="layui-inline width106">
							    	<label class="layui-form-label">2</label>
							    	<div class="layui-input-inline">
							    		<input type="hidden" name="ourIdxOur" value="2"/>
							    	</div>
							    </div>
							    <div class="layui-inline">
							    	<label class="layui-form-label"></label>
						      		<div class="layui-input-inline" style="margin-left:70px;">
							      		<input type="text" name="ourNameOur" value="折现率" readonly="readonly" style="border:0px" lay-verify="required" class="layui-input">
						      		</div>
							    </div>
							    <div class="layui-inline">
							      	<label class="layui-form-label" style="width:58px;"></label>
							      	<div class="layui-input-inline">
							      		<input type="text" name="ourPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">
							      	</div>
							    </div>
							    <div class="layui-inline">
							    	<button type="button" class="layui-btn layui-btn-sm" id="addOurBtn2" onclick="addOurRow(this);"><i class="layui-icon">&#xe654;</i></button>
							    	<button type="button" class="layui-btn layui-btn-sm" id="delOurBtn2" onclick="delOurRow(2)"><i class="layui-icon">&#xe640;</i></button>
							    </div>
						  	</div>
						  	<div class="layui-form-item" id="ourRow3">
						    	<div class="layui-inline width106">
							    	<label class="layui-form-label">3</label>
							    	<div class="layui-input-inline">
							    		<input type="hidden" name="ourIdxOur" value="3"/>
							    	</div>
							    </div>
							    <div class="layui-inline">
							    	<label class="layui-form-label"></label>
						      		<div class="layui-input-inline" style="margin-left:70px;">
							      		<input type="text" name="ourNameOur" value="投资回报率" readonly="readonly" style="border:0px" lay-verify="required" class="layui-input">
						      		</div>
							    </div>
							    <div class="layui-inline">
							      	<label class="layui-form-label" style="width:58px;"></label>
							      	<div class="layui-input-inline">
							      		<input type="text" name="ourPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">
							      	</div>
							    </div>
							    <div class="layui-inline">
							    	<button type="button" class="layui-btn layui-btn-sm" id="addOurBtn3" onclick="addOurRow(this);"><i class="layui-icon">&#xe654;</i></button>
							    	<button type="button" class="layui-btn layui-btn-sm" id="delOurBtn3" onclick="delOurRow(3)"><i class="layui-icon">&#xe640;</i></button>
							    </div>
						  	</div>
						  	<div class="layui-form-item" id="ourRow4">
						    	<div class="layui-inline width106">
							    	<label class="layui-form-label">4</label>
							    	<div class="layui-input-inline">
							    		<input type="hidden" name="ourIdxOur" value="4"/>
							    	</div>
							    </div>
							    <div class="layui-inline">
							    	<label class="layui-form-label"></label>
						      		<div class="layui-input-inline" style="margin-left:70px;">
							      		<input type="text" name="ourNameOur" value="工程下浮率" readonly="readonly" style="border:0px" lay-verify="required" class="layui-input">
						      		</div>
							    </div>
							    <div class="layui-inline">
							      	<label class="layui-form-label" style="width:58px;"></label>
							      	<div class="layui-input-inline">
							      		<input type="text" name="ourPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">
							      	</div>
							    </div>
							    <div class="layui-inline">
							    	<button type="button" class="layui-btn layui-btn-sm" id="addOurBtn4" onclick="addOurRow(this);"><i class="layui-icon">&#xe654;</i></button>
							    	<button type="button" class="layui-btn layui-btn-sm" id="delOurBtn4" onclick="delOurRow(4)"><i class="layui-icon">&#xe640;</i></button>
							    </div>
						  	</div>
						</div>	    
			  		</fieldset>
			  	</div>
			</fieldset>
			
			<fieldset class="layui-elem-field layui-field-title fieldset"  id="coopInfo">
		  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">项目合作方  ></legend>
			  	<div style="margin-top:20px">
			  		<div class="layui-form-item">				   
					    <div class="layui-inline">
					    	<label class="layui-form-label">报名牵头单位</label>
				      		<div class="layui-input-inline" style="width:300px;">
					      		<input type="text" id="id_signupLead" name="signupLead" style="border:0px;" readonly="readonly" class="layui-input">
				      		</div>
					    </div>
					</div>
			  		
				    <fieldset class="layui-elem-field layui-field-title fieldset"  id="summaryCoop">
				  		<legend style="margin-left:40px;font-size:15px;font-weight:bold;">联合体单位  ></legend>
					  	<div style="margin-top:20px" >					  	
						  	<div class="layui-form-item"  > 	
							  	<div class="layui-inline width106">  		
								  	<label class="layui-form-label">序号</label>		
								  	<div class="layui-input-inline"></div> 	
							  	</div> 	
						  		<div class="layui-inline">  		
						  			<label class="layui-form-label" ></label>					  	
						  	        <div class="layui-input-inline" style="margin-left:65px;">
						  	   		   <input type="text"  value="单位名称" readonly="readonly" style="border:0px" class="layui-input">  		
						  	   		</div> 	
						  	   	</div>
						  	   	<div class="layui-inline">  		
						  	   		<label class="layui-form-label" style="width:58px;"></label>  		
						  	   		<div class="layui-input-inline">   		  		
						  	   		<input type="text" value="单位作用" readonly="readonly" style="border:0px" class="layui-input">  		
						  	   		</div> 	
						  	   	</div>
						  	 </div>
						  	  
						</div>
						<div style="margin-top:20px" id="coopDiv">
						</div>
			  		</fieldset>
			  	</div>			  	
			</fieldset>
			
			<fieldset class="layui-elem-field layui-field-title fieldset"  id="boundary">
		  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">测算边界条件  ></legend>
			  	<div style="margin-top:20px">
			  		<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">项目资本金占比(%)</label>
							<div class="layui-input-inline">
								<input type="text" id="id_capitalPercent" name="capitalPercent" onblur="isNumberAndFloat1(this);"
									maxlength="6" placeholder="请输入" autocomplete="off" lay-verify="required|floatAmount" class="layui-input">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">政府出资比例（%）</label>
							<div class="layui-input-inline">
								<input type="text" id="id_gdProvidePercent" name="gdProvidePercent" onblur="isNumberAndFloat1(this);"
									maxlength="6" placeholder="请输入" autocomplete="off" lay-verify="required|floatAmount" class="layui-input">
							</div>
						</div>

						<div class="layui-inline">
							<label class="layui-form-label">银行融资成本利率（%）</label>
							<div class="layui-input-inline">
								<input type="text" id="id_bankCapInterest" name="bankCapInterest" onblur="isNumberAndFloat1(this);"
									maxlength="6" placeholder="请输入" autocomplete="off" lay-verify="required|floatAmount" class="layui-input">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">自有资金成本利率（%）</label>
							<div class="layui-input-inline">
								<input type="text" id="id_selfCostInterest" name="selfCostInterest" onblur="isNumberAndFloat1(this);"
									maxlength="6" placeholder="请输入" autocomplete="off" lay-verify="required|floatAmount" class="layui-input">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">各种保函费用利率（%）</label>
							<div class="layui-input-inline">
								<input type="text" id="id_etcInterest" name="etcInterest" onblur="isNumberAndFloat1(this);"
									maxlength="6" placeholder="请输入" autocomplete="off" lay-verify="required|floatAmount" class="layui-input">
							</div>
						</div>

						<div class="layui-inline">
							<label class="layui-form-label">融资通道费（万元）</label>
							<div class="layui-input-inline">
								<input type="text" id="id_capChannelFee" name="capChannelFee" onblur="isNumberAndFloat1(this);arabiaToCN(this,2);"
									maxlength="11" placeholder="请输入" autocomplete="off" lay-verify="required|floatAmount" class="layui-input">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">工程成本下浮率（%）</label>
							<div class="layui-input-inline">
								<input type="text" id="id_costDownRate" name="costDownRate" onblur="isNumberAndFloat1(this);"
									maxlength="6" placeholder="请输入" autocomplete="off" lay-verify="required|floatAmount" class="layui-input">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">工程承揽下浮率（%）</label>
							<div class="layui-input-inline">
								<input type="text" id="id_hireDownRate" name="hireDownRate" onblur="isNumberAndFloat1(this);"
									maxlength="6" placeholder="请输入" autocomplete="off" lay-verify="required|floatAmount" class="layui-input">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">居间人承揽项目下浮率（%）</label>
							<div class="layui-input-inline">
								<input type="text" id="id_midHireDownRate" name="midHireDownRate" onblur="isNumberAndFloat1(this);"
									maxlength="6" placeholder="请输入" autocomplete="off" lay-verify="required|floatAmount" class="layui-input">
							</div>
						</div>						
					</div>
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">居间人承揽工程量</label>
							<div class="layui-input-inline">
								<input type="text" id="id_midHire" name="midHire" maxlength="50"
									placeholder="请输入" autocomplete="off" lay-verify="required" class="layui-input">
							</div>
						</div>
					</div>
			  		<div class="layui-form-item">
						<label class="layui-form-label">未中标原因</label>
						<div class="layui-input-block">
							<textarea name="unbidReason" class="layui-textarea" maxlength="500"
								lay-verify="required" style="width: 899px; height: 90px;"></textarea>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">中标总结</label>
						<div class="layui-input-block">
							<textarea name="bidMemo" class="layui-textarea" maxlength="500"
								lay-verify="required" style="width: 899px; height: 90px;"></textarea>
						</div>
					</div>
			  	</div>
			</fieldset>
				
			<fieldset class="layui-elem-field layui-field-title fieldset" >
		  		<legend class="layui-btn layui-legend" style="text-align:left;cursor:default;">附件信息  ></legend>
			  	<div style="margin-top:20px;">
				    <div class="layui-form-item">
					    <label class="layui-form-label" style="width:350px;">支持pdf、excel、word、ppt、图片资料，可上传多个</label>
					</div>
				    <div class="layui-form-item">
					    <label class="layui-form-label">点检表</label>
					    <div class="layui-input-block">
					    	<div class="layui-upload">
				              	<button type="button" class="layui-btn" id="1-upload-more">上传</button>
		                		<div class="layui-upload-list" id="1-upload-more-list">
		                		</div>
				            </div>
					    </div>
				  	</div>
				    <div class="layui-form-item">
					    <label class="layui-form-label">招标文件</label>
					    <div class="layui-input-block">
					    	<div class="layui-upload">
				              	<button type="button" class="layui-btn" id="2-upload-more">上传</button>
		                		<div class="layui-upload-list" id="2-upload-more-list">
		                		</div>
				            </div>
					    </div>
				  	</div>
			  	</div>
			</fieldset>
			<div class="layui-form-item" style="position: fixed ! important; right: 30px; bottom:45%;z-index:10000;">
				<div class="layui-input-block">
		      		<button class="layui-btn layui-bg-blue layui-btn-normal layui-btn-lg  layui-btn-radius" type="button" lay-submit lay-filter="addInfo_form_submit" id="addInfo_form_submit">
		      		<i class="layui-icon layui-icon-ok layuiadmin-button-btn"></i>
		      		提交
		      		</button>
		      	</div>
		    </div>
		</form>
  		</div>
	</div>
</div>
  <script>
	//静态资源路径前缀
	var staticPath = '${fileHttpPre}';
	var stateJSON = <infopub:dicJson groupNo="A00010028" />;
	
  layui.config({
    base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'set', 'upload', 'element', 'laydate'], function(){
    var $ = layui.$
    ,form = layui.form
    ,element = layui.element
    ,laydate = layui.laydate
    ,upload = layui.upload;
    
 	// 正则校验
	form.verify({
		//验证汉字
	    CHS:[
	    	/^[\u0391-\uFFE5]+$/
	    	,'只能输入汉字'
	  	],
	  	//大于0的正整数
	  	intNumber:[
			/^[1-9]\d*$/
			,'请输入正确的数字'
	  	],
	  	//数字只能有两位小数
	  	floatNumber:[
			/^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
			,'请输入正确的数字'
	  	],
	  	//数字大于等于0，并只能有两位小数
	  	floatAmount:[
			/^([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
			//var pattern=/^((\d+\.\d*[1-9]\d{1})|(\d*[1-9]\d*\.\d{2}))$/; 
			,'请输入正确的数字'
	  	]
	});
 	
	//点检表
  	upload.render({
	      elem: '#1-upload-more'
	      ,url: basePath + '/afterSummary/uploadAtt/'
	      ,data: {
	    	  types:1
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var afterSummary = res.entity[i];
					var arr = afterSummary.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#1-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+afterSummary+'" id="fileAtt_'+arr[2]+'" name="fileAtts1" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
	//招标文件
  	upload.render({
	      elem: '#2-upload-more'
	      ,url: basePath + '/afterSummary/uploadAtt/'
	      ,data: {
	    	  types:2
	    		}
	      ,multiple: true
	      ,accept: 'file'
	      ,acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf'
	   	  ,before: function(obj){ //obj参数包含的信息
	   		    layer.load(); //上传loading
	   		  }
	      ,done: function(res){
	    	  //如果上传失败
	          if(res.code > 0){
	        	  layer.closeAll('loading'); //关闭loading
	        	  return layer.msg(res.msg,{icon: 7});
	          }
	          //上传完毕
	   	  	  if(res.entity != null && res.entity.length > 0){
				for(var i in res.entity){
					var afterSummary = res.entity[i];
					var arr = afterSummary.split("|");
					var imgSrc = "";
					var suffix = arr[1].substring(arr[1].lastIndexOf(".")+1,arr[1].length);
					if(suffix == 'jpg' || suffix == 'png'){
						imgSrc = "${fileHttpPre}/"+arr[3];
					}else{
						imgSrc = "${ctx}/resources/images/"+suffix+".jpg";
					}
	        		$('#2-upload-more-list').append('<div class="layui-upload-img-div" id="upload_img_'+arr[2]+'"><img src="'+imgSrc+'" title="'+ arr[1] +'" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\''+"${fileHttpPre}"+arr[3] +'\');">查看</a><a href="javascript:void(0)" onclick="del(\''+arr[2]+'\')";>删除</a></div><p>'+arr[1]+'</p><input type="hidden" value="'+afterSummary+'" id="fileAtt_'+arr[2]+'" name="fileAtts2" ></input></div> ');
				}
		  	  }
	      }
	      ,allDone: function(obj){ //当文件全部被提交后，才触发
	    	  layer.closeAll('loading'); //关闭loading
	      }
	      ,error: function(){
	    	  layer.closeAll('loading'); //关闭loading
	          //上传失败
	          layer.msg("上传失败，请稍后再试~",{icon: 7});
	        }
	    });
	
  	//项目名称select监听
    form.on('select(add_select_proId)', function(data){
    	var id = data.value;
    	if(id == null || id == ''){
    		return;
    	}
    	$("#id_hrDeptName").html('');
    	//通过项目名称带出所需要的的数据
		$.ajax({
			type : "POST", //提交方式  
			url : "${ctx}/afterSummary/getAfterSummaryById",//路径  
			data : {
				"proCodeAndCodes" :id
			},//数据，这里使用的是Json格式进行传输  
			success : function(result) {//返回数据根据结果进行相应的处理 
				if(result.flag==true){
					if(result.deciProVo!=null){
						//带出投标部门（营销经理所在部门）
						var deptList = '<option value="">请选择</option>';
						var staffDomains =[];
						staffDomains = result.deciProVo.staffOfficeDomains;
						if(staffDomains.length>0){
							for (var i = 0; i <staffDomains.length; i++) {
								deptList+= '<option value='+staffDomains[i].deptId+'>'+
								staffDomains[i].compName+"_"+staffDomains[i].deptName+'</option>';
							}
							$("#id_hrDeptName").append(deptList);						
						}
						//带出营销经理
						if(result.deciProVo.hrStaffName!=null&&result.deciProVo.hrStaffName!=''){
							$("#id_hrStaffName").val(result.deciProVo.hrStaffName);							
						}
						if(result.deciProVo.hrStaffId!=null&&result.deciProVo.hrStaffId!=''){
							$("#hrStaffId").val(result.deciProVo.hrStaffId);							
						}
						//带出投标截止日期
						if(result.deciProVo.bidEndDate!=null&&result.deciProVo.bidEndDate!=''){
							var bidEndDate = layui.util.toDateString(result.deciProVo.bidEndDate,"yyyy-MM-dd");
							$("#id_bidEndDate").val(bidEndDate);							
						}
						//带出牵头单位
						if(result.deciProVo.signUpLeads!=null&&result.deciProVo.signUpLeads!=''){
							$("#id_signupLead").val(result.deciProVo.signUpLeads);							
						}
						//带出联合体单位
						if(result.deciProVo.deciProCoopVos.length>0){				
							$('#coopDiv').html('');
						    layui.$.each(result.deciProVo.deciProCoopVos, function(ind,item){
						       var i = ind + 1;
						       var strBuffer = "";
						       
						       strBuffer += '<div class="layui-form-item" id="linkRow'+i+'">';
						       strBuffer += ' 	<div class="layui-inline width106">';
						       strBuffer += '  		<label class="layui-form-label">'+i+'</label>';
						       strBuffer += '		<div class="layui-input-inline">';
						       strBuffer += '			<input type="hidden" name="showIdx" value="'+i+'"/>';
						       strBuffer += ' 		</div>';
						       strBuffer += ' 	</div>';
						       strBuffer += ' 	<div class="layui-inline">';
						       strBuffer += '  		<label class="layui-form-label"></label>';
						       strBuffer += '  		<div class="layui-input-inline"  style="margin-left:65px;">';
						       strBuffer += '   		<input type="hidden" name="sgCoopIdCoop" value="'+item.sgCoopId+'">';
						       strBuffer += '   		<input type="text" name="sgCoopName" value="'+item.coopName+'" readonly="readonly" style="border:0px" class="layui-input">';
						       strBuffer += '  		</div>';
						       strBuffer += ' 	</div>';
						       strBuffer += ' 	<div class="layui-inline">';
					           strBuffer += '  		<label class="layui-form-label" style="width:58px;"></label>';
					           strBuffer += '  		<div class="layui-input-inline">';
						       strBuffer += '   		<input type="hidden" name="coopEffectCoop" value="'+item.coopEffect+'">';
						       strBuffer += '   		<input type="text" name="coopEffectName" value="'+item.coopEffectName+'" readonly="readonly" style="border:0px" class="layui-input">';
					           strBuffer += '  		</div>';
					           strBuffer += ' 	</div>';
						       strBuffer += '</div>';
						       $('#coopDiv').append(strBuffer);
						   });
						}
						form.render();
					}else{
						layer.msg('数据通信异常~',{icon: 0});
					}
				}				
			} 
		});
	});
    form.on('select(add_select_isBidFlag)', function(data) {
		var bidFlag = data.value;
		if(bidFlag=='0'){
			$("#summaryOur").show();
			$('input[name="ourName"]').attr("lay-verify","required");
			$('input[name="ourPriceMemo"]').attr("lay-verify","required");
			form.render();
		}else if(bidFlag=='1'){
			$("#summaryOur").hide();
			$('input[name="ourName"]').removeAttr("lay-verify");
			$('input[name="ourPriceMemo"]').removeAttr("lay-verify");
			form.render();
		}
	});
   	//监听提交
  	form.on('submit(addInfo_form_submit)', function(data){
  		//判断是否上传了点检表
		if ($("input[name=fileAtts1]").length < 1) {
			layer.msg("点检表未上传", {
				icon : 0
			});
			return;
		}
		//判断是否上传了招标文件
		if ($("input[name=fileAtts2]").length < 1) {
			layer.msg("招标文件未上传", {
				icon : 0
			});
			return;
		}
  		$("#addInfo_form_submit").removeAttr("lay-submit").removeClass("layui-bg-blue").addClass("layui-btn-disabled");
  		layer.load();
       	//提交 Ajax 成功后，静态更新表格中的数据
       	$.ajax({
           	type : 'post',
			url : basePath + '/afterSummary/save',
           	data: $('#addInfo_form').serialize(),
			success:function(result){
				if(result.success){
					layer.closeAll('loading'); //关闭loading
					layer.msg('提交单据成功~',{icon: 1});
					//两秒后关闭当前页面
					setTimeout(function(){
						/**
						 * 查找父菜单，并刷新
						 */
						var topDoc = $(window.top.document);
						var path = basePath + '/afterSummary/list';
						// 获取页面名称
						var name = topDoc.find(".layui-nav-item [lay-href^='" + path + "']").text();
						if(name == '' || name == null){
							name = '标后总结';
						}
						window.parent.layui.index.openTabsPage(path, name);
						var iframe = window.parent.layui.admin.tabsBody(window.parent.layui.admin.tabsPage.index).find(".layadmin-iframe");
						iframe[0].contentWindow.location.reload(true);
						
						/**
						 * 关闭当前页
						 */
						var currPath = basePath + '/afterSummary/add';
						var layid = topDoc.find("li[lay-id^='" + currPath + "']").attr('lay-id');
						window.parent.layui.element.tabDelete('layadmin-layout-tabs', layid);//关闭当前页
				        }, 2000);
				}else{
					layer.closeAll('loading'); //关闭loading
  					$("#addInfo_form_submit").removeClass("layui-btn-disabled").addClass("layui-bg-blue").attr("lay-submit","");
					layer.msg(result.msg,{icon: 7});
			  	}
			}
       	});
   	});  
 	// data-type事件
    $('.layui-btn.layuiadmin-btn-admin').on('click', function(){
      var type = $(this).data('type');
      active[type] ? active[type].call(this) : '';
    });
  	
  });
  
	//新增开标记录及排名
	function addRankRow(t){
		var $ = layui.$;
		var delBtnCount = $("button[id^='delRankBtn']").length;
		if(delBtnCount == 1){
			$("button[id^='delRankBtn']").each(function(){
				$(this).removeAttr("style");
			});
		}
		var thisid = $(t).attr("id").substring(10);
		thisid = $("div[id=rankRow" + thisid + "]").find("div:first").find("label").html();
		thisid = parseInt(thisid);
		var nextIndex = parseInt(thisid) + 1;
		var maxInd = $("div[id^='rankRow']").length;
		$("div[id^='rankRow']").each(function(){
			var tId = $(this).attr("id").substring(7);
			tId = parseInt(tId);
		  	if(tId > maxInd){
		  		maxInd = parseInt(tId);
		  	}
		  	var thisIndex = $(this).find("div:first").find("label").html();
		  	thisIndex = parseInt(thisIndex);
		  	var nextId = thisIndex + 1;
		  	if(thisIndex > thisid) {
		  		$("div[id=rankRow" + tId + "]").find("div:first").find("label").html(nextId);
		  		$("div[id=rankRow" + tId + "]").find(".width106").find("input").val(nextId);
		  	}
		});
		var ind = maxInd + 1;
		var medalHtml = '';
		
		medalHtml += '<div class="layui-form-item" id="rankRow'+ind+'">';
		medalHtml += '	<div class="layui-inline width106">';
		medalHtml += '		<label class="layui-form-label">'+nextIndex+'</label>';
		medalHtml += '		<div class="layui-input-inline">';
		medalHtml += '			<input type="hidden" name="itemIdxRank" value="'+nextIndex+'"/>';
		medalHtml += '		</div>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<label class="layui-form-label"></label>';
		medalHtml += '		<div class="layui-input-inline" style="margin-left:80px;">';
		medalHtml += '			<input type="text" name="itemNameRank" placeholder="请输入单位名称" maxlength="500" autocomplete="off" lay-verify="required" class="layui-input">';
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
   		medalHtml += '	<div class="layui-inline">';
   		medalHtml += '		<label class="layui-form-label" style="width:48px;"></label>';
   		medalHtml += '		<div class="layui-input-inline">'; 		
   		medalHtml += '			<input type="text" name="itemScoreRank" placeholder="请输入得分" autocomplete="off" onblur="isNumberAndFloat1(this);" lay-verify="required|floatAmount" class="layui-input">';
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addRankBtn'+ind+'" onclick="addRankRow(this);"><i class="layui-icon">&#xe654;</i></button>';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delRankBtn'+ind+'" onclick="delRankRow('+ind+');"><i class="layui-icon">&#xe640;</i></button>';
		medalHtml += '	</div>';
		medalHtml += '</div>';
		$(t).parent().parent().after(medalHtml);
		layui.form.render();
	}
	
	//删除一行
	function delRankRow(id){
		var $ = layui.$;
		layui.layer.confirm('确定删除？',{icon:3, title :'提示'}, function(index){
 		   	var thisid = $("div[id=rankRow" + id + "]").find("div:first").find("label").html();
	    	thisid = parseInt(thisid);
	    	$("div[id^='rankRow']").each(function(){
				var tId = $(this).attr("id").substring(7);
				tId = parseInt(tId);
			  	var thisIndex = $("div[id=rankRow" + tId + "]").find("div:first").find("label").html();
			  	thisIndex = parseInt(thisIndex);
			  	var nextId = thisIndex - 1;
			  	if(thisIndex > thisid) {
			  		$("div[id=rankRow" + tId + "]").find("div:first").find("label").html(nextId);
			  		$("div[id=rankRow" + tId + "]").find(".width106").find("input").val(nextId);
			  	}
			});
	    	$("#rankRow"+id).remove();
	    	var delBtnCount = $("button[id^='delRankBtn']").length;
			if(delBtnCount == 1){
				$("button[id^='delRankBtn']").each(function(){
					$(this).attr("style","display:none");
				});
			}
			layui.layer.close(index);
 		});
	}
  
	//新增中标单位报价
	function addBidRow(t){
		var $ = layui.$;
		var delBtnCount = $("button[id^='delBidBtn']").length;
		if(delBtnCount == 1){
			$("button[id^='delBidBtn']").each(function(){
				$(this).removeAttr("style");
			});
		}
		var thisid = $(t).attr("id").substring(9);
		thisid = $("div[id=bidRow" + thisid + "]").find("div:first").find("label").html();
		thisid = parseInt(thisid);
		var nextIndex = parseInt(thisid) + 1;
		var maxInd = $("div[id^='bidRow']").length;
		$("div[id^='bidRow']").each(function(){
			var tId = $(this).attr("id").substring(6);
			tId = parseInt(tId);
		  	if(tId > maxInd){
		  		maxInd = parseInt(tId);
		  	}
		  	var thisIndex = $(this).find("div:first").find("label").html();
		  	thisIndex = parseInt(thisIndex);
		  	var nextId = thisIndex + 1;
		  	if(thisIndex > thisid) {
		  		$("div[id=bidRow" + tId + "]").find("div:first").find("label").html(nextId);
		  		$("div[id=bidRow" + tId + "]").find(".width106").find("input").val(nextId);
		  	}
		});
		var ind = maxInd + 1;
		var medalHtml = '';
		
		medalHtml += '<div class="layui-form-item" id="bidRow'+ind+'">';
		medalHtml += '	<div class="layui-inline width106">';
		medalHtml += '		<label class="layui-form-label">'+nextIndex+'</label>';
		medalHtml += '		<div class="layui-input-inline">';
		medalHtml += '			<input type="hidden" name="bidIdxBid" value="'+nextIndex+'"/>';
		medalHtml += '		</div>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<label class="layui-form-label"></label>';
		medalHtml += '		<div class="layui-input-inline" style="margin-left:70px;">';
		medalHtml += '			<input type="text" name="bidNameBid" placeholder="请输入名称" autocomplete="off" lay-verify="required" class="layui-input">';
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
   		medalHtml += '	<div class="layui-inline">';
   		medalHtml += '		<label class="layui-form-label" style="width:58px;"></label>';
   		medalHtml += '		<div class="layui-input-inline">'; 		
   		medalHtml += '			<input type="text" name="bidPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">';
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addBidBtn'+ind+'" onclick="addBidRow(this);"><i class="layui-icon">&#xe654;</i></button>';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delBidBtn'+ind+'" onclick="delBidRow('+ind+');"><i class="layui-icon">&#xe640;</i></button>';
		medalHtml += '	</div>';
		medalHtml += '</div>';
		$(t).parent().parent().after(medalHtml);
		layui.form.render();
	}
	
	//删除一行
	function delBidRow(id){
		var $ = layui.$;
		layui.layer.confirm('确定删除？',{icon:3, title :'提示'}, function(index){
 		   	var thisid = $("div[id=bidRow" + id + "]").find("div:first").find("label").html();
	    	thisid = parseInt(thisid);
	    	$("div[id^='bidRow']").each(function(){
				var tId = $(this).attr("id").substring(6);
				tId = parseInt(tId);
			  	var thisIndex = $("div[id=bidRow" + tId + "]").find("div:first").find("label").html();
			  	thisIndex = parseInt(thisIndex);
			  	var nextId = thisIndex - 1;
			  	if(thisIndex > thisid) {
			  		$("div[id=bidRow" + tId + "]").find("div:first").find("label").html(nextId);
			  		$("div[id=bidRow" + tId + "]").find(".width106").find("input").val(nextId);
			  	}
			});
	    	$("#bidRow"+id).remove();
	    	var delBtnCount = $("button[id^='delBidBtn']").length;
			if(delBtnCount == 1){
				$("button[id^='delBidBtn']").each(function(){
					$(this).attr("style","display:none");
				});
			}
			layui.layer.close(index);
 		});
	}
	
	//新增我司报价
	function addOurRow(t){
		var $ = layui.$;
		var delBtnCount = $("button[id^='delOurBtn']").length;
		if(delBtnCount == 1){
			$("button[id^='delOurBtn']").each(function(){
				$(this).removeAttr("style");
			});
		}
		var thisid = $(t).attr("id").substring(9);
		thisid = $("div[id=ourRow" + thisid + "]").find("div:first").find("label").html();
		thisid = parseInt(thisid);
		var nextIndex = parseInt(thisid) + 1;
		var maxInd = $("div[id^='ourRow']").length;
		$("div[id^='ourRow']").each(function(){
			var tId = $(this).attr("id").substring(6);
			tId = parseInt(tId);
		  	if(tId > maxInd){
		  		maxInd = parseInt(tId);
		  	}
		  	var thisIndex = $(this).find("div:first").find("label").html();
		  	thisIndex = parseInt(thisIndex);
		  	var nextId = thisIndex + 1;
		  	if(thisIndex > thisid) {
		  		$("div[id=ourRow" + tId + "]").find("div:first").find("label").html(nextId);
		  		$("div[id=ourRow" + tId + "]").find(".width106").find("input").val(nextId);
		  	}
		});
		
		var ind = maxInd + 1;
		var medalHtml = '';
		
		medalHtml += '<div class="layui-form-item" id="ourRow'+ind+'">';
		medalHtml += '	<div class="layui-inline width106">';
		medalHtml += '		<label class="layui-form-label">'+nextIndex+'</label>';
		medalHtml += '		<div class="layui-input-inline">';
		medalHtml += '			<input type="hidden" name="ourIdxOur" value="'+nextIndex+'"/>';
		medalHtml += '		</div>';
		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<label class="layui-form-label"></label>';
		medalHtml += '		<div class="layui-input-inline" style="margin-left:70px;">';
		medalHtml += '			<input type="text" name="ourNameOur" placeholder="请输入名称" autocomplete="off" lay-verify="required" class="layui-input">';
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
   		medalHtml += '	<div class="layui-inline">';
   		medalHtml += '		<label class="layui-form-label" style="width:58px;"></label>';
   		medalHtml += '		<div class="layui-input-inline">'; 		
   		medalHtml += '			<input type="text" name="ourPriceMemo" placeholder="请输入报价" maxlength="10" autocomplete="off" lay-verify="required" class="layui-input">';
   		medalHtml += '		</div>';
   		medalHtml += '	</div>';
		medalHtml += '	<div class="layui-inline">';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="addOurBtn'+ind+'" onclick="addOurRow(this);"><i class="layui-icon">&#xe654;</i></button>';
		medalHtml += '		<button type="button" class="layui-btn layui-btn-sm" id="delOurBtn'+ind+'" onclick="delOurRow('+ind+');"><i class="layui-icon">&#xe640;</i></button>';
		medalHtml += '	</div>';
		medalHtml += '</div>';
		$(t).parent().parent().after(medalHtml);
		layui.form.render();
	}
	
	//删除一行
	function delOurRow(id){
		var $ = layui.$;
		layui.layer.confirm('确定删除？',{icon:3, title :'提示'}, function(index){
 		   	var thisid = $("div[id=ourRow" + id + "]").find("div:first").find("label").html();
	    	thisid = parseInt(thisid);
	    	$("div[id^='ourRow']").each(function(){
				var tId = $(this).attr("id").substring(6);
				tId = parseInt(tId);
			  	var thisIndex = $("div[id=ourRow" + tId + "]").find("div:first").find("label").html();
			  	thisIndex = parseInt(thisIndex);
			  	var nextId = thisIndex - 1;
			  	if(thisIndex > thisid) {
			  		$("div[id=ourRow" + tId + "]").find("div:first").find("label").html(nextId);
			  		$("div[id=ourRow" + tId + "]").find(".width106").find("input").val(nextId);
			  	}
			});
	    	$("#ourRow"+id).remove();
	    	var delBtnCount = $("button[id^='delOurBtn']").length;
			if(delBtnCount == 1){
				$("button[id^='delOurBtn']").each(function(){
					$(this).attr("style","display:none");
				});
			}
			layui.layer.close(index);
 		});
	}
	
	//删除文件
	function del(index){
		layui.$("#fileAtt_"+index).remove();
		layui.$("#upload_img_"+index).remove();
	}
  
	//根据url查看文件
	function showImg(url){
		var openWin = window.open(url,'','left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
	}
	
	//'请输入正确数字，且保留两位小数！'
	function isNumberAndFloat1(str) {
		var $ = layui.$, form = layui.form
		if (str.value == '' || str.value == null) {
			return;
		}
		var rgx = /^([-]?)([0-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;

		var boolrgx = rgx.test(str.value);// true 
		if (boolrgx) {
			return true;
		} else {
			str.value =0;
			layer.msg('请输入正确数字，且保留两位小数！');
			return false;
		}
	}
  </script>
</body>
</html>

